<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>My App</title>
    <link rel="stylesheet" href="../../packages/core/css/framework7.min.css">
  </head>
  <body>
    <div id="app">
      <div class="view view-main view-init">
        <div class="page">
          <div class="navbar">
            <div class="navbar-inner">
              <div class="left"></div>
              <div class="title">Pull To Refresh</div>
              <div class="right"></div>
            </div>
          </div><div class="page-content ptr-content">
<div class="ptr-preloader">
<div class="preloader"></div>
<div class="ptr-arrow"></div>
</div>
<div class="list media-list">
<ul>
<li class="item-content">
<div class="item-media"><img src="http://lorempixel.com/88/88/abstract/1" width="44"/></div>
<div class="item-inner">
<div class="item-title-row">
<div class="item-title">Yellow Submarine</div>
</div>
<div class="item-subtitle">Beatles</div>
</div>
</li>
<li class="item-content">
<div class="item-media"><img src="http://lorempixel.com/88/88/abstract/2" width="44"/></div>
<div class="item-inner">
<div class="item-title-row">
<div class="item-title">Don't Stop Me Now</div>
</div>
<div class="item-subtitle">Queen</div>
</div>
</li>
<li class="item-content">
<div class="item-media"><img src="http://lorempixel.com/88/88/abstract/3" width="44"/></div>
<div class="item-inner">
<div class="item-title-row">
<div class="item-title">Billie Jean</div>
</div>
<div class="item-subtitle">Michael Jackson</div>
</div>
</li>
</ul>
</div>
</div>
        </div>
      </div>
    </div>
    <script type="text/javascript" src="../../packages/core/js/framework7.min.js"></script>
    <script>
      var theme = 'ios';
      if (location.href.indexOf('theme=md') >= 0) theme = 'md';
      var plugin = {
        params: {
          theme: theme,
          root: '#app',
        }
      };
      if (Framework7.use) Framework7.use(plugin);
      else if (Framework7.Class && Framework7.Class.use) Framework7.Class.use(plugin);
      
    </script>
    <script>
      var app = new Framework7();
      
      var $$ = Dom7;
      
      // Dummy Content
      var songs = ['Yellow Submarine', 'Don\'t Stop Me Now', 'Billie Jean', 'Californication'];
      var authors = ['Beatles', 'Queen', 'Michael Jackson', 'Red Hot Chili Peppers'];
      // Pull to refresh content
      var $ptrContent = $$('.ptr-content');
      // Add 'refresh' listener on it
      $ptrContent.on('ptr:refresh', function (e) {
        // Emulate 2s loading
        setTimeout(function () {
          var picURL = 'http://lorempixel.com/88/88/abstract/' + Math.round(Math.random() * 10);
          var song = songs[Math.floor(Math.random() * songs.length)];
          var author = authors[Math.floor(Math.random() * authors.length)];
          var itemHTML =
            '<li class="item-content">' +
              '<div class="item-media"><img src="' + picURL + '" width="44"/></div>' +
              '<div class="item-inner">' +
                '<div class="item-title-row">' +
                  '<div class="item-title">' + song + '</div>' +
                '</div>' +
                '<div class="item-subtitle">' + author + '</div>' +
              '</div>' +
            '</li>';
          // Prepend new list element
          $ptrContent.find('ul').prepend(itemHTML);
          // When loading done, we need to reset it
          app.ptr.done(); // or e.detail();
        }, 2000);
      });
    </script>
  </body>
</html>